"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Window = function () {
};
Window.prototype.hello = function () {
    console.log('hello---4');
};
var createInstance = function (constructor) {
    var instance;
    return function Any() {
        if (!instance) {
            console.log('4   没有走缓存');
            //正常来说  此时this.__proto__ = Any.prototype
            constructor.apply(this, arguments);
            Object.setPrototypeOf(this, constructor.prototype);
            instance = this;
        }
        ;
        console.log('4  走缓存');
        return instance;
    };
};
//4 测试单例
var createWindow = createInstance(Window);
var w1 = new createWindow();
var w2 = new createWindow();
console.log("5 \u4E24\u4E2A\u5B9E\u4F8B\u662F\u5426\u4E00\u6837" + (w1 == w2));
